package com.event.management.backend.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.Map;

/**
 * 问卷答案数据传输对象
 */
@Data
@ApiModel(value = "问卷答案", description = "用户提交的问卷答案")
public class QuestionnaireAnswerDTO {
    
    @ApiModelProperty(value = "记录ID")
    private Long id;
    
    @ApiModelProperty(value = "关联活动ID", required = true)
    @NotNull(message = "活动ID不能为空")
    private Long eventId;
    
    @ApiModelProperty(value = "提交用户ID")
    private Long userId;
    
    @ApiModelProperty(value = "提交用户名称")
    private String userName;
    
    @ApiModelProperty(value = "关联电子票ID")
    private Long ticketId;
    
    @ApiModelProperty(value = "关联问卷模板ID")
    private Long templateId;
    
    @ApiModelProperty(value = "问卷模板标题")
    private String templateTitle;
    
    @ApiModelProperty(value = "答案内容", required = true, notes = "题目ID与答案的映射关系")
    @NotNull(message = "答案内容不能为空")
    private Map<String, Object> answers;
    
    @ApiModelProperty(value = "提交时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime submittedAt;
} 